#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
#include<string.h>
int main()
{
	int n = 0;
	scanf("%d", &n);
	int arr[n][n];
	gets(arr);
	int len = strlen(arr);
	int sum = 0;
	int j = 0,i=0;
	int a=0;
			for ( j = 0; j < n; j++)
			{
				sum += arr[i][j];
				if (arr[i][j] != 0)
					a++;
				i++;
				
			}
			i = n-1;
			for (j = 0; j <n; j++)
			{
				sum += arr[i][j];
				if (arr[i][j] != 0)
					a++;
				i--;
				
			}
			if (n % 2 != 1)
			{
				int mid = n / 2 + 1;
				sum -= arr[mid][mid];
				a--;
			}
			printf("sum = %d, count = %d.", sum,a);//sum = 16, count = 7.
	return 0;
}